﻿(function (Ctn){
//创建遮盖层
function createMask(){
    var elemMask = document.createElement("div");
    elemMask.id = 'CTN_DIV_MASK';
    elemMask.className = "el-mask";
    //创建iframe 用于遮盖select
    if (Ctn.browser.ie('6-')){
        $(elemMask).append('<iframe frameborder="0" marginwidth="0" style="width:100%;height:100%;filter:alpha(opacity=0);"></iframe>');
    }
    document.body.appendChild(elemMask);
    return elemMask;
}

Ctn.extend(Ctn, {
//显示遮盖层
showMask: function(options){
    var el = $('#CTN_DIV_MASK');
    if (options === false){
        el.hide();
        $(window).unbind('resize', Ctn.showMask);
    } else {
        if (el.length < 1){
            el = $(createMask());
        }
        $(window).resize(Ctn.showMask);
        el.height(Ctn.getDocHeight());
        el.width(Ctn.getDocWidth());
        if (typeof(options) == 'object') {
            el.css(options);
        }
        el.show();
    }
},
dragAble: function(){

}
});
})(Ctn);